package com.faner.fast.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum CodeEnum {
    SUCCESS(0,"操作成功"),

    SUCCESS_ADD(0,"添加成功"),

    SUCCESS_UPDATE(0,"修改成功"),

    SUCCESS_DELETE(0,"删除成功"),

    FAIL(1,"操作失败"),

    FAIL_REPEAT_LOGIN(20,"您的账号已在其他设备登录。如非本人操作，建议修改密码"),

    FAIL_NEED_LOGIN(401,"登录已过期，请重新登录"),

    FAIL_ACL_DENY(403,"对不起，您没有权限进行此操作"),

    INTERNAL_SERVER_ERROR(9999, "服务器未知错误"),

    UN_AUTHORIZATION(10000,  "认证失败"),

    UN_AUTHENTICATION(10010, "授权失败"),

    NOT_FOUND(10020, "资源不存在"),

    PARAMETER_ERROR(10030, "参数错误"),

    TOKEN_INVALID(10040, "令牌失效"),

    TOKEN_EXPIRED(10050,  "令牌过期"),

    DUPLICATED(10060, "字段重复"),

    FORBIDDEN(10070, "禁止操作"),

    METHOD_NOT_ALLOWED(10080, "请求方法不允许"),

    REFRESH_FAILED(10100,  "刷新令牌获取失败"),

    FILE_TOO_LARGE(10110,  "文件体积过大"),

    FILE_TOO_MANY(10120, "文件数量过多"),

    FILE_EXTENSION(10130, "文件扩展名不符合规范"),

    REQUEST_LIMIT(10140,  "请求过于频繁，请稍后重试");


    //业务状态码
    private Integer code;
    private String message;

    public static void main(String[] args) {
        System.out.println(CodeEnum.REQUEST_LIMIT.getCode());
    }
}
